package com.jiuwan.gamepass.auth;

import com.jiuwan.gamepass.dto.authDto.Result;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
import org.springframework.stereotype.Component;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @version 1.0
 * 功能目的描述 ：用于   注销成功处理器      ========>>>>>>>>>>>
 * @author： pang-yun
 * @date： 2021-06-23 20:25
 */
@Component
public class MyLogoutSuccessHandler extends JSONAuthentication implements LogoutSuccessHandler {
    @Override
    public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
        Result result= Result.ok().message("注销成功");
        this.WriteJSON(request,response,result);
    }
}
